package com.compus.controller;

import com.compus.constant.EnableStatus;
import com.compus.entity.po.Position;
import com.compus.entity.vo.Result;
import com.compus.service.PositionService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


@Tag(name = "站点")
@RestController
@RequestMapping("/position")
public class PositionController {

    @Resource
    private PositionService positionService;

    @Operation(summary = "获取站点列表")
    @GetMapping("/list")
    public Result<List<Position>> list() {
        return Result.success(positionService.lambdaQuery()
                .eq(Position::getStatus, EnableStatus.ENABLE)
                .list());
    }




}
